package com.yxh.springboot.demo.controller;

import com.yxh.springboot.demo.pojo.User;
import com.yxh.springboot.demo.service.Impl.UserServiceImpl;
import com.yxh.springboot.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: yuxinhang
 * @Date: 2022/6/14 20:05
 * @Description
 */
@Controller
public class UserController {

    @Resource
    private UserServiceImpl userService;

    @RequestMapping("/findAll")
    @ResponseBody
    public List<User> findAllUser(){
        return userService.findAll();
    }
}
